<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>04_JS运算符</title>
</head>
<body>
<script>
    console.log(3>10);//false
    console.log(3>'10');//false Number('10')=>10 3>10？
    console.log('3'>10);//false
    console.log('奇'>'宇');//都是字符串比较的是字符的编码值
    console.log('奇'.charCodeAt());
    console.log('宇'.charCodeAt())
    console.log('3'>'10');
    console.log('3'.charCodeAt());//51
    console.log('13'.charCodeAt(0));//49
    console.log('13'.charCodeAt(1));//51

    let  a = 1;
    let b = true;
    //松散比较运算符会比较左右两边的值，严格比较运算符会先比较类型，类型相同再比较值
    console.log(a == b);//1==Number(true)值都是1 结果为true
    console.log(a === b);//number != boolean =>false
    //三元运算符
    let c = 0;
    console.log(c == 0 ? 'YES' : 'NO');
    //赋值类型 0 是false 所以是NO
    console.log(c = 0 ? 'YES'  : 'NO');
    //


</script>
</body>
</html>